package istar.impl;

import istar.IElement;
import istar.IElementLink;
import istar.IGoal;

public class AndDecomposition extends AbstractElementLink implements IElementLink {

	public AndDecomposition(String name, IGoal owner,
			IGoal subElement) {
		super(name, owner, subElement);
	}

	public AndDecomposition(String name) {
		super(name);
	}

	@Override
	public void setOwner(IElement owner) throws Exception {
		if (owner.getClass().equals(Goal.class)){
			super.setOwner((IGoal)owner);
		}
		else throw new Exception("Invalid argument type!" + owner.getClass());
	}

	/*

    @Override
	public void setTargetElement(IElement target) throws Exception {
		if (target.getClass().equals(Goal.class)){
			super.setTargetElement((IGoal)target);
		}
		else throw new Exception("Invalid argument type!" + target.getClass());
	}
	*/
}
